<?php 
	require_once('lib/DBConnection5.Class.php');
	$SERVER = "localhost";
	$DBASE = "test";
	$USERNAME = "root";
	$PASSWORD = "";
	
	//DB Object initialization
    $DBOBJ = new myclass($SERVER, $DBASE, $USERNAME, $PASSWORD);
	
	$name = filterData($_POST['name']);
	$address = filterData($_POST['address']);
	$email = filterData($_POST['email']);
	$phone = filterData($_POST['phone']);
	$gender = filterData($_POST['gender']);
	$shootdate = filterData($_POST['shootdate']);
	$comments = filterData($_POST['comments']);
		
	/*Insert Query*/	
	$insertSql = "INSERT INTO `contact` (`id`, `name`, `address`, `email`, `phone`, `gender`, `shootdate`, `comments`) 
					VALUES (NULL, '".$name."', '".$address."', '".$email."', '".$phone."', '".$gender."', '".$shootdate."', '".$comments."');";
	$result = $DBOBJ->insert($insertSql);
	
	function filterData($escapeString) {
		return mysql_real_escape_string($escapeString);
	}
	
	/*
	CREATE TABLE `contact` (
	`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
	`name` VARCHAR( 255 ) NOT NULL ,
	`address` VARCHAR( 500 ) NOT NULL ,
	`email` VARCHAR( 255 ) NOT NULL ,
	`phone` VARCHAR( 50 ) NOT NULL ,
	`gender` VARCHAR( 10 ) NOT NULL ,
	`shootdate` DATE NOT NULL ,
	`comments` TEXT NOT NULL
	) ENGINE = InnoDB;
	
	*/
	
	
?>